<div id="Updating-a-file"></div>
<div class="header">
<p>
Next: [[cvs: Conflicts example#Conflicts example|Conflicts example]], Previous: [[cvs: File status#File status|File status]], Up: [[cvs: Multiple developers#Multiple developers|Multiple developers]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>

----

<div id="Bringing-a-file-up-to-date"></div>
=== Bringing a file up to date ===
<div id="index-Bringing-a-file-up-to-date"></div>
<div id="index-Updating-a-file"></div>
<div id="index-Merging-a-file"></div>
<div id="index-Update_002c-introduction"></div>

When you want to update or merge a file, use the <code>update</code>
command.  For files that are not up to date this is roughly equivalent
to a <code>checkout</code> command: the newest revision of the file is
extracted from the repository and put in your working directory.

Your modifications to a file are never lost when you
use <code>update</code>.  If no newer revision exists,
running <code>update</code> has no effect.  If you have
edited the file, and a newer revision is available,
<small>CVS</small> will merge all changes into your working copy.

For instance, imagine that you checked out revision 1.4 and started
editing it.  In the meantime someone else committed revision 1.5, and
shortly after that revision 1.6.  If you run <code>update</code> on the file
now, <small>CVS</small> will incorporate all changes between revision 1.4 and 1.6 into
your file.

<div id="index-Overlap"></div>
If any of the changes between 1.4 and 1.6 were made too
close to any of the changes you have made, an
<em>overlap</em> occurs.  In such cases a warning is
printed, and the resulting file includes both
versions of the lines that overlap, delimited by
special markers.
See [[cvs: update--Bring work tree in sync with repository#update&mdash;Bring work tree in sync with repository|update]], for a complete description of the
<code>update</code> command.

This document was generated on <i>a sunny day</i> using [http://www.nongnu.org/texi2html/ <i>texi2html</i>].
